package cn.com.surker.sale.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 销售结算信息表
 * </p>
 *
 * @author admin
 * @since 2024-06-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SaleContractBill implements Serializable {

	private static final long serialVersionUID = 1L;

	@TableId(value = "id", type = IdType.AUTO)
	private Long id;

	/**
	 * 公司ID
	 */
	private Long orgId;

	/**
	 * 公司
	 */
	private String orgName;

	/**
	 * 公司全称
	 */
	private String orgFull;

	/**
	 * 项目ID
	 */
	private Long conId;

	/**
	 * 项目名称
	 */
	private String conName;

	/**
	 * 施工单位ID
	 */
	private Long buildId;

	/**
	 * 施工单位
	 */
	private String build;

	/**
	 * 收货单位ID
	 */
	private Long clientId;

	/**
	 * 收货单位
	 */
	private String client;

	/**
	 * 类型(0：结算类型A，1：结算类型B)
	 */
	private Integer type;

	/**
	 * 销售人员
	 */
	private String saleMan;

	/**
	 * 销售量
	 */
	private Double saleStere;

	/**
	 * 销售总金额
	 */
	private Double salePrice;
	/**
	 * 销售总金额
	 */
	private Double taxSalePrice;

	/**
	 * 对账开始时间
	 */
	private String startDate;

	/**
	 * 对账结束时间
	 */
	private String endDate;

	/**
	 * 是否导出(0:未导出1:已导出)
	 */
	private Integer isExport;

	/**
	 * 审核金额
	 */
	private Double examinePrice;
	/**
	 * 审核结算方量
	 */
	private Double examineStere;

	/**
	 * 结算月份
	 */
	private String today;

	/**
	 * 销售内业审核(0：未审核，1：已审核)
	 */
	private Integer isSale;

	/**
	 * 财务审核(0:未审核,1:已审核)
	 */
	private Integer isFinance;

	/**
	 * 结算时间点 0 公司产值 1工地
	 */
	private Integer billTimeType;

	/**
	 * 结算单类型(0：结算办理:1：结算单补录)
	 */
	private Integer billType;

	/**
	 * 截止上期结算金额
	 */
	private Double lastBillPrice;
	/**
	 * 累计上期结算方量
	 */
	private Double lastBillStere;

	/**
	 * 累计结算方量
	 */
	private Double billStere;

	/**
	 * 累计总付款金额
	 */
	private Double payment;

	/**
	 * 状态(0:启用1：禁用)
	 */
	private Integer status;

	/**
	 * 审核备注，当审核结果为不通过时，必填
	 */
	private String remark;

	/**
	 * 创建人
	 */
	private String creater;

	/**
	 * 创建日期
	 */
	@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss",timezone="GMT+8")
	private Date createTime;
	/**
	 * 审核日期
	 */
	@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss",timezone="GMT+8")
	private Date examineTime;

	/**
	 * 更新人
	 */
	private String updater;

	/**
	 * 更新日期
	 */
	@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss",timezone="GMT+8")
	private Date updateTime;


	@TableField(exist = false)
	private List<SaleContractBillDetail> detailList = new ArrayList<>();

	public SaleContractBill(){}

	public SaleContractBill(Long orgId, String orgName, String orgFull, Long conId, String conName, Long buildId, String build, Long clientId, String client, Integer type,String saleMan, Double saleStere, Double salePrice, String startDate, String endDate, Integer isExport, Double lastBillPrice, Double billStere, Double payment, Integer status, String remark, String creater, Date createTime) {
		this.orgId = orgId;
		this.orgName = orgName;
		this.orgFull = orgFull;
		this.conId = conId;
		this.conName = conName;
		this.buildId = buildId;
		this.build = build;
		this.clientId = clientId;
		this.client = client;
		this.saleMan = saleMan;
		this.type = type;
		this.saleStere = saleStere;
		this.salePrice = salePrice;
		this.startDate = startDate;
		this.endDate = endDate;
		this.isExport = isExport;
		this.lastBillPrice = lastBillPrice;
		this.billStere = billStere;
		this.payment = payment;
		this.status = status;
		this.remark = remark;
		this.creater = creater;
		this.createTime = createTime;
	}
}
